namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;


    [System.SerializableAttribute()]
    [Map("PERSONS")]
    public class Person : ObjectRow
    {

        public Person()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public Person(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected Person(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
            base(info, context)
        {
        }

        [Key("ID", true, true)]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Field("SEX")]
        public string Sex
        {
            get
            {
                return (System.String)GetValue("SEX");
            }
            set
            {
                SetValue("SEX", value);
            }
        }


        [Field("MANAGER_ID")]
        public decimal MANAGERID
        {
            get
            {
                try
                {
                    return (System.Decimal)GetValue("MANAGERID");
                }
                catch (Exception ex) { return 0; }
            }
            set
            {
                SetValue("MANAGERID", value);
            }
        }
        [Field("Org_ID")]
        public int OrgID
        {
            get
            {
                return (System.Int32)GetValue("OrgID");
            }
            set
            {
                SetValue("OrgID", value);
            }
        }


        [Field("ACTIVE")]
        public Boolean ACTIVE
        {
            get
            {
                return (System.Boolean)GetValue("ACTIVE");
            }
            set
            {
                SetValue("ACTIVE", value);
            }
        }

        [Field("NAME")]
        public string Name
        {
            get
            {
                return (System.String)GetValue("NAME");
            }
            set
            {
                SetValue("NAME", value);
            }
        }


        [Field("Telephone")]
        public string Telephone
        {
            get
            {
                return (System.String)GetValue("Telephone");
            }
            set
            {
                SetValue("Telephone", value);
            }
        }

        [Field("TYPE")]
        public Byte Type
        {
            get
            {
                return (Byte)GetValue("TYPE");
            }
            set
            {
                SetValue("TYPE", value);
            }
        }

        [Field("POSITION")]
        public string Position
        {
            get
            {
                return (System.String)GetValue("POSITION");
            }
            set
            {
                SetValue("POSITION", value);
            }
        }



        [Field("FAX")]
        public string FAX
        {
            get
            {
                return (System.String)GetValue("FAX");
            }
            set
            {
                SetValue("FAX", value);
            }
        }

        [Field("E_MAIL")]
        public string EMAIL
        {
            get
            {
                return (System.String)GetValue("EMAIL");
            }
            set
            {
                SetValue("EMAIL", value);
            }
        }

        [Field("CONTACT_TIMES_ID")]
        public decimal CONTACTTIMESID
        {
            get
            {
                return (System.Decimal)GetValue("CONTACTTIMESID");
            }
            set
            {
                SetValue("CONTACTTIMESID", value);
            }
        }

        [Field("LAST_UPDATER")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }


        [Field("DOMAIN_ID")]
        public decimal DOMAINID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAINID");
            }
            set
            {
                SetValue("DOMAINID", value);
            }
        }

        [Field("Last_Name")]
        public string LastName
        {
            get
            {
                return (System.String)GetValue("LastName");
            }
            set
            {
                SetValue("LastName", value);
            }
        }

        [Field("LAST_UPDATE_TIME")]
        public Decimal LAST_UPDATE_TIME
        {
            get
            {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        /// <summary>
        /// 身份证号码
        /// </summary>
        [Field("IdentityCode")]
        public string Identity
        {
            get
            {
                return (System.String)GetValue("Identity");
            }
            set
            {
                SetValue("Identity", value);
            }
        }

        /// <summary>
        /// 编码
        /// </summary>
        [Field("CODE")]
        public string Code
        {
            get
            {
                return (System.String)GetValue("Code");
            }
            set
            {
                SetValue("Code", value);
            }
        }




    }
}
